package com.wind.plugin.openAction.Listener;

import com.intellij.openapi.vfs.VirtualFileEvent;
import com.intellij.openapi.vfs.VirtualFileAdapter;
import com.wind.plugin.openAction.CustomTextEditorAi;

public class CustomFileListener extends VirtualFileAdapter {
    private final CustomTextEditorAi editor;

    public CustomFileListener(CustomTextEditorAi editor) {
        this.editor = editor;
    }

    @Override
    public void contentsChanged(VirtualFileEvent event) {
        if (event.getFile().equals(editor.getVirtualFile())) {
            editor.onFileContentChanged();
        }
    }
}
